﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GTAuto.DAL.DAL;
using GTAuto.DAL.Entities;
using GTAuto.DAL.Enums;

namespace GTauto.Site.FrontEnd.Controllers
{
    public class DiscsController : Controller
    {
      
        public ActionResult DiscByBrand(int id,string ses)
        {
            int count;

            List<GTModel> models;

            models = DALModels.Singleton.GetByBrand(id, 1, 1000, out count) ;
            ViewBag.Brand = DALBrands.Singleton.Get(id);
            return View(models);
        }


        public ActionResult DiscByModel(int id)
        {
            ViewBag.All = "active";
            GTModel curModel = DALModels.Singleton.Get(id);
            int count;
            var models =  DALModels.Singleton.GetByBrand(curModel.BrandId, 1, 1000, out count);


            ViewBag.CurModel = curModel;
            ViewBag.Brand = DALBrands.Singleton.Get(curModel.BrandId);
            ViewBag.Models = models;
             

            List<GTModelModification> gtModelModifications = DALModelModification.Singleton.GetAll(id);
            ViewBag.Mods = gtModelModifications;



            return View(curModel);
        }




    }


    
}
